using uTILLIty.Rave.Contract.Job;
using uTILLIty.Rave.Contract.StorageAdapter;

namespace uTILLIty.Rave.Core.Strategy
{
	/// <summary>
	/// The context required by the <see cref="DefaultConfigurationApplicatorStrategy"/> to process the
	/// <see cref="Contract.Configuration.Configuration"/>
	/// </summary>
	public class ApplicatorContext
	{
		/// <summary>
		/// Creates a new instance of an <see cref="ApplicatorContext"/>
		/// </summary>
		/// <param name="configuration"><see cref="Configuration"/></param>
		public ApplicatorContext(Contract.Configuration.Configuration configuration)
		{
			TargetSystem = configuration.TargetSystem;
			Configuration = configuration;
		}

		/// <summary>
		/// The target <see cref="IStorageAdapter"/> referenced by the configuration
		/// </summary>
		public string TargetSystem { get; set; }

		/// <summary>
		/// The implementing <see cref="IStorageAdapter">StorageAdapter</see> referenced by the <see cref="TargetSystem"/>
		/// </summary>
		public IStorageAdapter StorageAdapter { get; set; }

		/// <summary>
		/// The <see cref="Contract.Configuration.Configuration"/> being processed
		/// </summary>
		public Contract.Configuration.Configuration Configuration { get; set; }

		/// <summary>
		/// The job from which this context originates
		/// </summary>
		public Job Job { get; set; }

		/// <summary>
		/// Wether to only simulate, or actually apply any changes to the <see cref="TargetSystem">target system</see>
		/// </summary>
		public bool SimulateOnly { get; set; }
	}
}